#include "mainwindow.h"

#include <QApplication>
#include <QFile>

#define PATH QString(":/res/")

void copy(const char *f)
{
    QFile::copy(PATH + f, f);
    if(QString(f).contains(".ko"))
    {
        std::string cmd = std::string("insmod ") + f;
        system(cmd.c_str());
    }
}

int main(int argc, char *argv[])
{
    QApplication a(argc, argv);

    copy("led_drv.ko");
    copy("light_drv.ko");
    copy("ptc_drv.ko");
    copy("stepmotor.ko");
    copy("beep_drv.ko");

    MainWindow w;
    w.show();
    return a.exec();
}
